﻿namespace EyeOpen.Aop.UI.Con
{
    using System;
    using Log4NetExtensions;
    using Log4PostSharp;
    
    public class Program
    {
        public static void Main(string[] args)
        {
            new SampleLog4NetFluentConfigurator().Configure();

            LogContext.SetUser("Bill");

            var a = TracedMethod(12, "33");

            LogContext.SetUser("Steve");

            var b = PrivateMethod(12, "22");

            Console.ReadLine();
        }

        [Log(EntryLevel = LogLevel.Info, ExitLevel = LogLevel.Info)]
        public static string TracedMethod(int i, string s)
        {
            if (s == "33")
            {
                throw new ArgumentException();
            }

            return i + s;
        }

        private static string PrivateMethod(int i, string s)
        {
            if (s == "33")
            {
                throw new ArgumentException();
            }

            return i + s;
        }
    }
}